<template>
    <div>
        <div>
            <p>名字：{{list.name  }}</p>
            <p>类型：{{ list.valid_start  }} /{{list.valid_type}}</p>
            <p>范围：{{list.receive_type | fanwei }}</p>
            <p>天数： {{ list.grant  |  zhuang   }}</p>
            <p>规则：{{ list.receive_type  |  lei   }}</p>

        </div>

    </div>
</template>
<script>
import { coupon } from '../../../api/api4'
export default {
  data() {
    return {
      id: this.$route.query.id,
      list: []
    }
  },
  mounted() {
    coupon(this.id).then((res) => {
      console.log(res)
      this.list = res.data
    })
  },
  methods: {},
  filters: {
    fanwei: function(www) {
      let q = ''
      let w = ''
      if (www == 1) {
        q = '班课'
      }
      if (www == 1) {
        w = '全部课程'
      }
      return q + '/' + w
    },
    zhuang: function(qqq) {
      if (qqq == 1) {
        return qqq = '领取中'
      } else {
        return qqq = '已结束'
      }
    },
    lei: function(qqq) {
      if (qqq == 1) {
        return qqq = '领取'
      } else {
        return qqq = '捐赠'
      }
    }
  }
}
</script>
<style scoped>

</style>
